package com.wnx.job.modules.jms.dto;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Date;

@Data
public class StudentParam implements Serializable {

    /**
     * 自增主键
     */
    @ApiModelProperty(value = "ID")
    private Long id;


    /**
     * 姓名
     */
    @Excel(name = "姓名")
    @ApiModelProperty(value = "姓名")
    @NotBlank(message = "姓名不能为空")
    @Length(min = 2, max = 10)
    private String name;


    /**
     * 账号(学号)
     */
    @Excel(name = "学号",width = 20,needMerge = true)
    @ApiModelProperty(value = "账号(学号)")
    @NotBlank(message = "账号不能为空")
    @Length(min = 8,max = 14,message = "学号长度在8到14位")
    private String account;


    /**
     * 出生日期
     */
    @Excel(name = "出生日期",width = 20,format = "yyyy/MM/dd")
    @ApiModelProperty(value = "出生日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Past(message = "出生日期输入错误")
    @NotNull(message = "出生日期不能为空")
    private Date birthday;


    /**
     * 专业
     */
    @ApiModelProperty(value = "专业")
    @NotNull(message = "专业不能为空")
    private Long professionId;


    /**
     * 毕业院校
     */
    @Excel(name = "毕业院校")
    @ApiModelProperty(value = "毕业院校")
    @NotBlank(message = "毕业院校不能为空")
    private String college;

    /**
     * 受教育程度
     */
    @Excel(name = "受教育程度")
    @ApiModelProperty(value = "受教育程度")
    @NotBlank(message = "受教育程度不能为空")
    private String education;

    /**
     * 手机号码
     */
    @Excel(name = "手机号码",width = 20,needMerge = true)
    @ApiModelProperty(value = "手机号码")
    @NotBlank(message = "手机号码不能为空")
    @Length(min = 11,max = 11)
    private String phone;

    /**
     * 性别
     */
    @Excel(name = "性别",width = 10,replace = {"男_1","女_2"})
    @ApiModelProperty(value = "性别")
    @NotNull(message = "性别不能为空")
    private Integer sex;

    /**
     * 照片
     */
    @ApiModelProperty(value = "一寸证件照")
    private String photo;

    /**
     * 毕业日期
     */
    @Excel(name = "毕业日期",width = 20,format = "yyyy/MM/dd")
    @ApiModelProperty(value = "毕业日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Future(message = "毕业日期输入错误！")
    private Date graduateDate;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    private Date created;

    /**
     * 修改时间
     */
    @ApiModelProperty(value = "更新时间")
    private Date updated;

    /**
     * 状态
     */
    @ApiModelProperty(value = "状态")
    @NotNull(message = "状态值不能为空！")
    private Integer status;


    /**
     * 政治面貌
     */
    @ApiModelProperty(value = "政治面貌")
    private String political;


    /**
     * 性格描述
     */
    @ApiModelProperty(value = "性格描述")
    private String description;


    /**
     * 邮箱
     */
    @Email(message = "邮箱格式不正确")
    @NotBlank(message = "邮箱不能为空")
    @ApiModelProperty(value = "邮箱")
    @Excel(name = "邮箱")
    private String email;



    //==========附加字段========//
    /**
     * 专业名称
     */
    @Excel(name = "专业")
    private String profession;
    //==========附加字段========//

}
